#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

int removeDuplicates(int* nums, int numsSize) {
    int i = 0, j = 1;
    while (j < numsSize)
    {
        if (nums[i] == nums[j])
            j++;
        else { nums[++i] = nums[j++]; }
    }
    return i + 1;
}
int main()
{
    int a[10] = { 0,0,1,1,1,2,2,3,3,4 };
    int c=removeDuplicates(a, 10);
    for(int i=0;i<c;i++)
    printf("%d",a[i]);
}